home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / JFC.bin / BadLocationException.java < prev    next >
Text File  |  1998-06-30  |  2KB  |  60 lines

  1. /*
  2.  * @(#)BadLocationException.java    1.11 98/04/09
  3.  * 
  4.  * Copyright (c) 1997 Sun Microsystems, Inc. All Rights Reserved.
  5.  * 
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  * 
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  * 
  19.  */
  20. package com.sun.java.swing.text;
  21.  
  22. /**
  23.  * This exception is to report bad locations within a document model
  24.  * (that is, attempts to reference a location that doesn't exist).
  25.  * <p>
  26.  * Warning: serialized objects of this class will not be compatible with
  27.  * future swing releases.  The current serialization support is appropriate
  28.  * for short term storage or RMI between Swing1.0 applications.  It will
  29.  * not be possible to load serialized Swing1.0 objects with future releases
  30.  * of Swing.  The JDK1.2 release of Swing will be the compatibility
  31.  * baseline for the serialized form of Swing objects.
  32.  *
  33.  * @author  Timothy Prinzing
  34.  * @version 1.11 04/09/98
  35.  */
  36. public class BadLocationException extends Exception
  37. {
  38.     /**
  39.      * Creates a new BadLocationException object.
  40.      * 
  41.      * @param s        a string indicating what was wrong with the arguments
  42.      * @param offs      offset within the document that was requested >= 0
  43.      */
  44.     public BadLocationException(String s, int offs) {
  45.     super(s);
  46.     this.offs = offs;
  47.     }
  48.  
  49.     /**
  50.      * Returns the offset into the document that was not legal.
  51.      *
  52.      * @return the offset >= 0
  53.      */
  54.     public int offsetRequested() {
  55.     return offs;
  56.     }
  57.  
  58.     private int offs;
  59. }
  60.